home *** CD-ROM | disk | FTP | other *** search
- /*
- ** File mfldef.c
- ** Source file for custom LDEF for MultiFile dialog.
- **
- ** Copyright © Eric Schlegel 1987, 1988
- */
-
-
- #include <types.h>
- #include <quickdraw.h>
- #include <lists.h>
- #include "mfpriv.h"
-
- pascal void Debugger()
- extern 0xA9FF;
-
- pascal void mfldef(lmsg, lselect, lrect, lcell, loffset, ldatalen, lhandle)
- short lmsg;
- Boolean lselect;
- Rect *lrect;
- Cell lcell;
- short loffset;
- short ldatalen;
- ListHandle lhandle;
- {
- void doinit();
- void dodraw();
- void dohilite();
-
- switch (lmsg) {
- case lInitMsg:
- doinit(lhandle);
- break;
- case lDrawMsg:
- /* only column 0 needs to be drawn */
- if (!lcell.h)
- dodraw(lselect, lrect, loffset, lhandle);
- break;
- case lHiliteMsg:
- /* ditto as above */
- if (!lcell.h)
- dohilite(lrect);
- break;
- }
- }
-
- void doinit(lhandle)
- ListHandle lhandle;
- {
- FontInfo fntinfo;
-
- GetFontInfo(&fntinfo);
- SetPt(&((*lhandle)->indent), 4, fntinfo.ascent);
- }
-
- void dodraw(lselect, lrect, loffset, lhandle)
- Boolean lselect;
- Rect *lrect;
- short loffset;
- ListHandle lhandle;
- {
- MFCELL *data;
- short strlen;
-
- HLock((*lhandle)->cells);
-
- data = *((*lhandle)->cells) + loffset;
-
- PenNormal();
- MoveTo(lrect->left + (*lhandle)->indent.h, lrect->top + (*lhandle)->indent.v);
- DrawText(data->fname.text, 0, data->fname.length);
-
- HUnlock((*lhandle)->cells);
-
- if (lselect)
- InvertRect(lrect);
- }
-
- void dohilite(lrect)
- Rect *lrect;
- {
- InvertRect(lrect);
- }